home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / Universal AIncludes / MacRuntime.a < prev    next >
Encoding:
Text File  |  1994-10-20  |  4.2 KB  |  106 lines  |  [TEXT/MPS ]

  1. ;  File MacRuntime.a
  2. ;
  3. ;  Copyright Apple Computer, Inc. 1994
  4. ;  All rights reserved.
  5. ;
  6. ;  Include File for Accessing the MacRuntime Libraries
  7.  
  8. ;  Set CASE OBJECT to assure references to the names IMPORTed here link
  9. ;  properly.  The following statements restore the CASE setting to its
  10. ;  previous value.
  11.  
  12.     IF &TYPE('__INCLUDINGMACRUNTIME__') = 'UNDEFINED' THEN
  13. __INCLUDINGMACRUNTIME__    SET    1
  14.  
  15.             PRINT            Push,Off            ; save current print settings and turn it off
  16.             GBLC            &S%%%,&P%%%
  17. &S%%%        SETC            &Setting('CASE')    ; save current CASE setting
  18. &P%%%        SETC            &Setting('PRINT',1) ; and PRINT settings before we changed them
  19.  
  20.             MACRO
  21.             X%%%
  22.             GBLC            &S%%%,&P%%%         ; link references with previously defined variables
  23.             PRINT            Push,&P%%%            ; restore the previous PRINT settings
  24.             CASE            &S%%%                ; and restore the CASE setting
  25.             PRINT            POP                 ; restore the PRINT settings
  26.             ENDM
  27.  
  28.             PRINT            Pop                 ; restore the PRINT settings
  29.             CASE            OBJECT                ; all imported/exported names case significant
  30.  
  31. ;  MacRuntime Globals
  32.  
  33.             IMPORT            MacOSErr            ; 0 if no error, error value otherwise
  34.                                                 ; added from errors.a • rjd 941017
  35.             
  36.             IMPORT            StandAlone            ; a long, 0 if in shell, 1 if standalone
  37.             
  38.     IF (&TYPE('NURUNTIME') <> 'UNDEFINED') THEN
  39. _#StandAlone    DS.L        StandAlone
  40.     ENDIF
  41.  
  42. ;    MacRuntime Utility Routines
  43.  
  44. ;** pascal Boolean TrapAvailable (short TrapNumber);
  45.  
  46.             IMPORT            TRAPAVAILABLE        ; Determine if a Trap is available
  47.             
  48.  
  49.  
  50. ;    68K CFM Runtime and Shared Library Support Routines
  51. ;
  52. ; ****
  53. ; NOTE:     These Support Routines were made obsolete for E.T.O. #16 • rjd 941017
  54. ; ****
  55. ;
  56. ; NOTE:  To use these routines, you must define the symbol 'NURUNTIME' at
  57. ;         assembly time.
  58. ;
  59. ;    IF (&TYPE('NURUNTIME') <> 'UNDEFINED') THEN
  60. ;
  61. ;** LinkupQDGlobals is called from the default CFM init routine %__INIT.
  62. ;** Please Refer to FragLoad.h for the prototype of custom init routines.
  63. ;** If you create your own init routine you must call LinkupQDGlobals before
  64. ;** any other code you write (and that code MAY NOT call Quickdraw)
  65. ;**
  66. ;** LinkupQDGlobals purpose is to create a linked list of all the "per context" 
  67. ;** A5 Worlds in a given application context so that QuickDraw will find a 
  68. ;** "QD globals" pointer at A5+0 no matter which A5World is currently ref'd by A5.
  69. ;**
  70. ;** The linked list built by LinkupQDGlobals uses the lomem global CurrentA5
  71. ;** and builds the list thru the qd Globals pointers at A5+0, IF InitGraf() has
  72. ;** NOT yet been called; Otherwise LinkupQDGlobals just copies the value of the 
  73. ;** QuickDraw globals pointer (at the location pointed to by CurrentA5) into 
  74. ;** the A5+0; i.e. into the A5World of the code fragment containing LinkupQDGlobals.
  75. ;**
  76. ;** LinkupQDGlobals is and MUST REMAIN a staticly linked routine, called by the
  77. ;** init routine of each separate code fragment. It may not be exported or shared.
  78. ;**
  79. ;** LinkupQDGlobals will only return an error if it is called and the A5World
  80. ;** referenced by the lomem pointer CurrentA5 is NOT a NuRuntime A5World AND 
  81. ;** QuickDraw has NOT been initialized.  This condition can occur ONLY if an 
  82. ;** "old"/"Classic" 68K model application is attempting to use the CFM API directly.
  83. ;**
  84. ;** The routine BindQDGlobalsList must be called IMMEDIATELY before the application
  85. ;** initialization call of QuickDraw's InitGraf() routine, WITH THE SAME parameter 
  86. ;** passed to InitGraf.  BindQDGlobalsList resolves the linked list of A5Worlds
  87. ;** created by LinkupQDGlobals.  This will cause all the A5Worlds to have a valid
  88. ;** pointer at A5+0 to the same QuickDraw Globals.
  89. ;**
  90. ;** Shared Libraries that have "Global" sharing (i.e 1 copy of data in system heap)
  91. ;** must have customized Init Routines and probably will require a private copy of 
  92. ;** the quickdraw globals that are created manually and A5+0 initialized without
  93. ;** calling QuickDraw's InitGraf() IF such libraries are to call QuickDraw (directly
  94. ;** or indirectly) at all.  The most likely case of a "data only" globally shared 
  95. ;** fragment will not need to have an init routine that fixes up A5+0, since no code
  96. ;** will ever execute with A5 referencing its A5World.
  97. ;** 
  98. ;** pascal OSErr LinkupQDGlobals(void);
  99. ;** pascal void BindQDGlobalsList(void* globalPtr);
  100. ;** 
  101. ;
  102. ;            IMPORT            LINKUPQDGLOBALS
  103. ;            IMPORT            BINDQDGLOBALSLIST
  104. ;
  105.     ENDIF
  106.